<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<title>药品列表</title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
    .box-body{
    margin-top:-2px;
    }    	
    </style>
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1>药品列表</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#">交易</a></li>
            <li class="active"><a href="#">药品列表</a></li>
        </ol>
    </section>
    
    <section class="content">
      <form id="form" method="post" class="form-horizontal">    
        <div class=" box box-success">
            <div class="box-body">
               <div class="input">
                    <div class="textalign1"><spring:message code="message.listForm.tongYongMing"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="drugName" name="drugName" placeholder="<spring:message code="message.listForm.tongYongMing"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
                    <div class="textalign1"><spring:message code="message.listForm.ShengChanQiYe"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="compName" name="compName" placeholder="<spring:message code="message.listForm.ShengChanQiYe"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
                    <div class="textalign1"><spring:message code="message.listForm.ZhongBiaoQiYe"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="catCompName" name="catCompName" placeholder="<spring:message code="message.listForm.ZhongBiaoQiYe"/>/<spring:message code="message.listForm.pinYinMa"/>" />
                    </div>
               </div>
               <div class="input">
					<div class="textalign1"><spring:message code="message.listForm.XiangMuMingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="projName" name="projName" placeholder="<spring:message code="message.listForm.XiangMuMingCheng"/>" />
                    </div>
					<div class="textalign1"><spring:message code="message.lable.status"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <select class="textinput" id="status" name="status">
                            <option value=""><spring:message code="message.select.option"/></option>
                            <option value="1"><spring:message code="message.listForm.QiYong"/></option>
                            <option value="0"><spring:message code="message.listForm.TingYong"/></option>
                        </select>
                    </div>
                    <div class="textalign1">药品来源<spring:message code="message.yanZheng.maoHao"/></div>
                        <div class="boxinput">
                        <select class="textinput"  id="goodsSource" name="goodsSource">
                        <option value=""><spring:message code="message.select.option"/></option>
                        <c:forEach items="${list }" var="list">
                            <option value="${list.dicCode }">${list.dicName }</option>
                        </c:forEach>
                        </select>
                    </div>
                    <div class="textalign1">
                       <button type="button" onclick="gridSerch()" class="btn btn-success btn-sm" id="selectDicCompType"><spring:message code="message.button.seachSpacing"/></button>
					</div>
               </div>
            </div>
           </div>
        </form> 
        <table class="jqgrid" id="gridlist"></table>
        <div id="prowed2"></div>
		<div class=" box box-warning bottongroup" id="bottongroup">
		    <label onclick="batchStatus(1);" class="btn btn-primary btn-sm"><spring:message code="message.button.startSpacing"/></label>
			<label onclick="batchStatus(0);" class="btn btn-primary btn-sm"><spring:message code="message.button.stopSpacing"/></label>
			<%-- <label onclick="window.location.href='${ctx}/baseGoods/toImportFileList.html';" class="btn btn-primary btn-sm">批量导入</label> --%>
		</div>              
                        <div class="form-group form-group-xs">
                                <table class="jqgrid col-sm-1" id="gridlist1"></table>
                                <div id="gridpage1 col-sm-1"></div>
                            </div>
                      
          <div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <table id="listy"></table>
                    <div id="prowedy"></div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" onclick="save();" class="btn btn-primary btn-sm"><spring:message code="message.button.saveSpacing"/></button>
                        <button type="button" class="btn btn-danger btn-sm" data-dismiss="modal"><spring:message code="message.button.closeSpacing"/></button>
                    </div>
                </div>
            </div>
            
            <!-- 批量导入 -->
            <div class="modal fade" id="batchImport" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header bg-primary">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h5 class="modal-title" id="exampleModalLabel"><spring:message code="message.button.DaoRu"/></h5>
                    </div>
                    <div class="modal-body">
                    <div class="form-group form-group-xs">
								<label for="recipient-name" class=" control-label">模板下载：</label>
								<div class="">
								<a href="${ctx }/baseGoods/downloadModel.html">商品导入模板</a>
								</div>
							</div>
                    
                        <form name="importform" id="importform" method="post" action="${ctx }/baseGoods/bathImportView.html" enctype="multipart/form-data">
                            <div class="form-group form-group-xs">
                                <label for="recipient-name" class="control-label"><spring:message code="message.listForm.DaoRuWenJian"/>:</label>
                                <input type="file" name="goodFile" id="goodFile"/>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" onclick="bathImport();" class="btn btn-primary btn-sm"><spring:message code="message.button.DaoRu"/></button>
                        <button type="button" id="closeImport" class="btn btn-danger btn-sm" data-dismiss="modal"><spring:message code="message.button.closeSpacing"/></button>
                        
                    </div>
                </div>
            </div>
        </div>
	
<div style="margin-top: 10px;"></div>
	<form action="${ctx}/stdCompinfo/toStdCompinfoDetailJsp.html"
		id="FormDetail" method="post">
		<input type="hidden" name="compCodeDetail" id="compCodeDetail" /> 
	</form>
</section>
<%@ include file="/WEB-INF/component/commonJS.jsp"%>
<script type="text/javascript">
//绑定回车
$('#drugName,#projName,#compName,#goodsCode,#drugCode,#catCompName,#isLowprice,#isSmallprice,#isSmallsource,#goodsSource,#status').bind('keydown', function(event) {
    if (event.keyCode == "13") {
        $('#selectDicCompType').click();
    }
});	
$("#drugName").focus();//加载页面光标在第一个查询框内



    var searchType = 0;
    
    function moreSerch(obj) {
    	if (searchType == 0) {
    		searchType = 1;
    		$("div.moreSerch").slideDown();
    		$(obj).html("<spring:message code="message.button.JianDanChaXun"/>");
    	} else {
    		searchType = 0;
    		$("div.moreSerch").slideUp();
    		$(obj).html("<spring:message code="message.button.GaoJiChaXun"/>");
    		$("#goodsCode,#drugCode,#catCompName,#isLowprice,#isSmallprice,#isSmallsource").val("");
    	}
    }

		function bathImport(){
			var fileName = $.trim($("#goodFile").val());
			if (fileName == ""){
				$.HN.message.alert("<spring:message code="message.yanZheng.QingXuanZeDaoRuWenJian"/><spring:message code="message.yanZheng.ganTanHao"/>", "<spring:message code="message.HN.alert.type"/>", "warn");
				return;
			}
			$("#importform").submit();
		}
		
		
		function switchStatus(goodsCode,status){
            var msg = "<spring:message code="message.listForm.TingYong"/>";
            if(status == 1){
                var msg = "<spring:message code="message.listForm.QiYong"/>";
            }
            $.HN.message.confirm("<spring:message code="message.lable.OKYES"/>"+msg+"<spring:message code="message.lable.ma"/>", '', '').on(function (e) {
                if (e) {
            $.post("${pageContext.request.contextPath}/baseGoods/switchStatus.html", {
                goodsCode : goodsCode, status : status
            }, function(result) {
                if (result.success) {
                    gridSerch();
                    $.HN.message.alert("操作成功！", "<spring:message code="message.HN.alert.type"/>", "success");
                } else {
                    $.HN.message.alert("操作失败！", "<spring:message code="message.HN.alert.type"/>", "error");
                }
            }, "json")
                }
            }); 
        }
		

		//启用,停用
		function batchStatus(status) {
    		var statusName = "<spring:message code='message.button.start' />";
        	if (status == 0){
        		statusName = "<spring:message code='message.button.stop' />";
        	}
        	//获取选中的ID及对应的名字（参数:jqgridId,名字列名，状态列名，当前操作即列表中显示的值），返回infos[0]是ID串，infos[1]是名字串
        	var infos = batchSwitchStatus("gridlist","qualityspecName","status",statusName,"通用名");
        	if ( !(infos instanceof Array)){
        		return;
        	}
      	    $.HN.message.confirm('<spring:message code='message.button.confirm' />'+statusName+'<spring:message code='message.lable.yiXia' /><spring:message code='message.listForm.yaoPin' /><spring:message code='message.yanZheng.wenHao' /><br/>'+infos[1].replace(/\,/g,"<br/>"), '', '').on(function (e) {
                if (e) {
                	
                	  var list = [];
                	  var temp= infos[0].split(",");
                    for (var i=0; i<temp.length; i++) {
                        rowId = temp[i];
                        list.push({"goodsCode":rowId});
                    }
                	$.ajax({
                        url: "${pageContext.request.contextPath}/baseGoods/batchSwitchStatus.html",//action地址
                        data: {"status":status,"array":json.jsonToString(list)},//传值
                        type: "post",//执行方式get or post 默认以post方式执行
                        dataType:"json",
                        success: function (result) {//执行成功后 提示
                            if (result.success){
                            	top.$.HN.message.alert("成功"+statusName+infos[0].split(",").length+"条<spring:message code='message.listForm.yaoPin' /><spring:message code="message.yanZheng.ganTanHao"/>","", "success");
                            	gridSerch( $("#gridlist").getGridParam("page"));
                            } else {
                        	   top.$.HN.message.alert("<spring:message code='message.HN.alert.fail' /><spring:message code="message.yanZheng.ganTanHao"/>","", "error");
                            } 
                        }
                    });
                }
            });
    	}
	
		$(function () {
		jQuery("#gridlist").jqGrid({
			url: "${ctx}/baseGoods/getDataList.html",
		    mtype: "POST",
			datatype: "json",
			autowidth: true,
			shrinkToFit:false,
		   	colNames:[
		   	          '<spring:message code="message.jqGrid.cz"/>',
		   	          '<spring:message code="message.lable.status"/>',
		   	          '<spring:message code="message.listForm.shangBianMa"/>',
		   	          '<spring:message code="message.listForm.ZhongBiaoJia"/>',
                      '<spring:message code="message.listForm.ZhongBiaoHouLingShouJia"/>',
                      '<spring:message code="message.listForm.yaoPinBianMa"/>',
                      '<spring:message code="message.listForm.tongYongMing"/>', 
                      '<spring:message code="message.listForm.jiXing"/>',
                      '<spring:message code="message.listForm.guiGe"/>',
                      '<spring:message code="message.listForm.zhuanHuanXiShu"/>',
                      '<spring:message code="message.listForm.baoZhuangDanWei"/>', 
                      '<spring:message code="message.listForm.caiZhi"/>',
                      '<spring:message code="message.listForm.shengChanQiYe"/>',
                      '国药准字',
					  '<spring:message code="message.listForm.yaoPinLaiYuan"/>',
					  '药品类别',
		   	          '<spring:message code="message.listForm.ZhongBiaoQiYe"/>',
		   	          '<spring:message code="message.listForm.XiangMuMingCheng"/>',
		   	          '<spring:message code="message.listForm.BeiAnLeiXing"/>',
		   	          '<spring:message code="message.listForm.ShangPinFenLei"/>',
		   	          '<spring:message code="message.listForm.shiFouDiJiaYao"/>',
		   	          '<spring:message code="message.listForm.shiFouLianJiaYao"/>',
		   	          '<spring:message code="message.listForm.shiFouGongYinJinZhangYao"/>'
		   	          ],
		   	colModel:[
                {name:'oper',index:'oper', width:60,sortable: false, align:"center",
		            formatter : function(val, opts, rowdata) {
			        var str = "";
			      	str = "<a href=\"${ctx}/baseGoods/toHaveSetDel.html?goodsCode="+rowdata.goodsCode+"&areaId="+rowdata.areaId+"\" style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -140px -60px' class='opIcon' title='配送方案'></a>";
			      	return str;
	              }	
                },
                {name:'status',index:'statusText',sortable: false, width:60, align:"center",sorttype:false,
                    cellattr:function (rowId, val, rawObject, cm) {
                        if(val == '<spring:message code="message.button.stop"/>'){
                            return 'style="color:red"';
                        }
                    },
                    formatter : function(val, opts, rowdata) {
                        var str = "";
                        if(rowdata.status == 1){
                            str += "<spring:message code="message.button.start"/>";
                        }
                        if(rowdata.status == 0){
                            str += "<spring:message code="message.button.stop"/>";
                        }
                        return str;
                    }
                },
                
				{name:'goodsCode',sortable: false, hidden:true,index:'goodsCode', width:100,align:"center", sorttype:false
				},
				{name:'proPriceLimit',sortable: false,index:'proPriceLimit', width:80, align:"right",sorttype:false,
                    formatter:function(cellvalue, options, row){ 
                    return formatAmount(cellvalue, options, row);
                    }},
	            {name:'retailPriceLimit',sortable: false,index:'retailPriceLimit', width:100, align:"right",sorttype:false,
	                formatter:function(cellvalue, options, row) {
	                    var f_x = Math.round(cellvalue * 100) / 100;
	                    var s_x = f_x.toString();
	                    var pos_decimal = s_x.indexOf('.');
	                    
	                    if (pos_decimal < 0) {
	                        pos_decimal = s_x.length;
	                        s_x += '.';
	                    }
	                    
	                    while (s_x.length <= pos_decimal + 2) {
	                        s_x += '0';
	                    }
	                    return s_x;
	                }
	            },
	            {name:'drugCode',index:'drugCode',sortable: false,  width:100, align:"center",sorttype:false,hidden:true},
		   		{name:'qualityspecName',sortable: false,index:'drugName', width:140,align:"left", sorttype:false},
		   		{name:'formName',index:'formName', sortable: false,width:80, align:"center"},
		   		{name:'specName',index:'specName',sortable: false, width:80, align:"left",sorttype:false},
		   		{name:'factor',index:'factor', sortable: false,width:80, align:"center",sorttype:false},
		   		{name:'unitName',index:'unit', sortable: false,width:60, align:"center",sorttype:false},
		   		{name:'materialName',index:'materialName',sortable: false, width:80, align:"left",sorttype:false,hidden:true},
		   		{name:'compName',index:'compName', sortable: false,width:180, align:"left",sorttype:false},
		   		{name:'drugMedicine',index:'drugMedicine', sortable: false,width:180, align:"left",sorttype:false},
				{name:'goodsSourceName',index:'goodsSourceName',sortable: false, width:80, align:"left",sorttype:false},
				{name:'drugAttr',index:'drugAttr',sortable: false, width:80, align:"left",sorttype:false,
					formatter : function(val, opts, rowdata) {
						var str = "";
                        if (val == 1) {
                            str = "国家基本药物";
                        } else if (val == 2) {
                            str = "非基本药物";
                        } else if (val == 3) {
                            str = "省增补基本药物";
                        } 
                        return str;
					}
				},
		  		{name:'catCompName',index:'compName',sortable: false, width:180, align:"left",sorttype:false},
               
               {name:'projName',index:'projName',sortable: false, width:180, align:"left",sorttype:false},
               			
				{name:'isLongtimePlan',index:'isLongTimePlanText',sortable: false, width:80, align:"center",sorttype:false,hidden:true,
					formatter : function(val, opts, rowdata) {
						var str = "";
                        if (val == 0) {
                            str = "<spring:message code="message.listForm.LinShiBeiAn"/>";
                        } else if (val == 1) {
                            str = "<spring:message code="message.listForm.ChangQiBeiAnLeiXing"/>";
                        } 
                        return str;
					}
				},
		   		{name:'drugCat',index:'drugCatText',sortable: false, hidden:true, width:100, align:"center",sorttype:false,
					formatter : function(val, opts, rowdata) {
                        var str = "";
                        if (val == 1) {
                            str = "<spring:message code="message.listForm.HuaXueJiShengWuZhiYao"/>";
                        } else if (val == 2) {
                            str = "<spring:message code="message.listForm.ZhongChengYao"/>";
                        } else if (val == 3) {
                            str = "<spring:message code="message.listForm.ZhongYaoYingPian"/>";
                        }
                        return str;
                    }
		   		},
		   		
                {name:'isLowprice', width:80,sortable: false, align:"center",sorttype:false,hidden:true,
                    formatter : function(val, opts, rowdata) {
                        var str = "";
                        if (val == 0) { 
                            str = "<spring:message code="message.listForm.fou"/>";
                        } else if (val == 1) {
                            str = "<spring:message code="message.listForm.shi"/>";
                        } else if (val == 9) {
                            str = "<spring:message code="message.listForm.WeiZhi"/>";
                        }
                        return str;
                    }
                },
                {name:'isSmallprice', width:80,sortable: false, align:"center",sorttype:false,hidden:true,
                    formatter : function(val, opts, rowdata) {
                        var str = "";
                        if (val == 0) {
                            str = "<spring:message code="message.listForm.fou"/>";
                        } else if (val == 1) {
                            str = "<spring:message code="message.listForm.shi"/>";
                        } else if (val == 9) {
                            str = "<spring:message code="message.listForm.WeiZhi"/>";
                        }
                        return str;
                    }
                },
                {name:'isSmallsource', width:90,sortable: false, align:"center",sorttype:false,hidden:true,
                    formatter : function(val, opts, rowdata) {
                        var str = "";
                        if (val == 0) {
                            str = "<spring:message code="message.listForm.fou"/>";
                        } else if (val == 1) {
                            str = "<spring:message code="message.listForm.shi"/>";
                        } else if (val == 9) {
                            str = "<spring:message code="message.listForm.WeiZhi"/>";
                        }
                        return str;
                    }
                }
		   	],
			 rowNum: 20,
		     rowList: [10, 20, 50, 100],
		     rownumbers: true,
		     multiselect: true,
		     pager: "#prowed2",
		     viewrecords: true,
		     gridComplete: function(){
             	//序号列宽度自适应（参数为jqgridID）
                autoRNWidth("gridlist");
             	//数据只有一条时默认选中（参数为jqgridID）
                 selectByOneData("gridlist");
		     },
		     caption: "药品列表",
		     jsonReader: {
		         repeatitems: false,
		         id: "goodsCode"
		     }
		   	
		});
			 
			jQuery("#gridlist").jqGrid('navGrid',"prowed2",{edit:false,add:false,del:false});
			$(window).trigger("resize");
			$("#gridlist").jqGrid("setGridHeight",create());
			
			
		});
		
		function gridSerch() {
            var drugName = $.trim($("#drugName").val());
            var projName = $.trim($("#projName").val());
            var compName = $.trim($("#compName").val());
            var goodsCode = $.trim($("#goodsCode").val());
            var drugCode = $.trim($("#drugCode").val());
            var catCompName = $.trim($("#catCompName").val());
            var isLowprice = $.trim($("#isLowprice").val());
            var isSmallprice = $.trim($("#isSmallprice").val());
            var isSmallsource = $.trim($("#isSmallsource").val());
            var goodsSource = $.trim($("#goodsSource").val());
            var status = $.trim($("#status").val());

            $("#gridlist").jqGrid('setGridParam', {  
                datatype:'json',
                postData:{
                    "drugName":drugName,
                    "projName":projName,
                    "compName":compName,
                    "goodsCode":goodsCode,
                    "drugCode":drugCode,
                    "catCompName":catCompName,
                    "isLowprice":isLowprice,
                    "isSmallprice":isSmallprice,
                    "isSmallsource":isSmallsource,
                    "goodsSource":goodsSource,
                    "status":status
                },
                page:1
            }).trigger("reloadGrid"); //重新载入  
        }
		
		    
		    function stop(){
		    	var checked = false;
		    	 $("input.cbox").each(function() {
		    	     if($(this).is(":checked")) {
		    	    	 checked = true;
		    	    	 return false;
		    	     };
		    	 });
		    	 
		    	 if (!checked) {
		    		 $.HN.message.alert('<spring:message code="message.yanZheng.QingXuanZeYaoStopDeTiaoMu"/>', '<spring:message code="message.HN.alert.type"/>', 'warn');
		    	 }else{
		   	 $.HN.message.confirm("<spring:message code="message.yanZheng.QueDingYaoTingYongMa"/><spring:message code="message.yanZheng.wenHao"/>", '', '').on(function (e) {
		           if (e) {
		               $.HN.message.alert('操作成功！', '<spring:message code="message.HN.alert.type"/>', 'success');
		               window.location.href="onSellDrugListCenter.jsp";
		               
		           }
		       });
			   
		       }
		    }
		   $("#allDelete1").click(function(){
			   var checked = false;
		   	 $("input.cbox").each(function() {
		   	     if($(this).is(":checked")) {
		   	    	 checked = true;
		   	    	 return false;
		   	     };
		   	 });
		   	 
		   	 if (!checked) {
		   		 $.HN.message.alert('<spring:message code="message.yanZheng.QingXuanZeYaoStartDeTiaoMu"/><spring:message code="message.yanZheng.wenHao"/>', '<spring:message code="message.HN.alert.type"/>', 'warn');
		   	 }else{
		     	 $.HN.message.confirm("<spring:message code="message.yanZheng.QueDingYaoQiYongMa"/><spring:message code="message.yanZheng.wenHao"/>", '', '').on(function (e) {
		              if (e) {
		                  $.HN.message.alert('<spring:message code="message.HN.alert.success"/>', '<spring:message code="message.HN.alert.type"/>', 'success');
		                  window.location.href="onSellDrugListCenter.jsp";
		                  
		              }
		          });
		   	 }
		     });
		   
			function goJsp(n1){
				
				var opt ={
						url:"../../jsp/price/priceChangeExeDetailGrid.jsp",
						title:"newwindow",
		style:{height:400,width:890,top:200,left:270}
				};
				$.HN.dialog.open(opt);
				
		}    
		    function selectComp(){
		 	   
		 		$("#compCode").val("");
		 	    $("#compName").val("");
		 	 gridCompSerch();
		 	   $('#selectComp').modal({
		 			keyboard : true
		 		});
		 	   
		 	  
		    }
		    function gridCompSerch() {
		    	var compCode = $("#compCode").val();
		    	var compName = $("#compName").val();
		 		$("#gridlist1").jqGrid('setGridParam',{  
		 	        datatype:'json',
		 	        postData:{"compCode":compCode,
		 	        		"compName":compName}
		 	    }).trigger("reloadGrid"); //重新载入  
		 	}
		    function gridOk(){
		 	   var compId = $("#gridlist1").jqGrid('getGridParam', 'selrow');
		        if (compId == null) {
		     	   $.HN.message.alert('<spring:message code="message.yanZheng.QingZhiShaoXuanYiTiao"/><spring:message code="message.yanZheng.ganTanHao"/>', '<spring:message code="message.HN.alert.type"/>', 'warn');
		            return;
		        }
		        var rowdata = $("#gridlist1").jqGrid('getRowData', compId);
		        $("#prodPompId").val(compId);
		        $("#comp").val(rowdata.compName);
		        $("#selectComp").modal("hide");
		        
		    }
		    function cleandata(){
		 	   $("#prodPompId").val("");
		        $("#comp").val("");
		        $("#selectComp").modal("hide");
		    }
		    function operResult(val){
		        
		    }
		    function fileUp(){
		    	$('#batchImport').modal({
                    keyboard: true
                });
		    }
		    
		    
		    $('#importform').ajaxForm({ 
			    dataType: 'json', 
		    	success: function(returnData) {
		    	if(returnData.success) {
		    		$.HN.message.alert('导入成功！', '提示信息', 'success');
		    		$("#batchImport").modal("hide");
				}else{
					$.HN.message.alert('添加失败，请重新添加！', '提示信息', 'success');
		    	}
		       } 	
		   });
</script>
</body>
</html>